﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace InnovTech.Util.Crypto
{
    public class BytesGenerator
    {

        static Guid DefaultPassword = new Guid("3BE371EA-C12E-4D5C-A7FB-C4A67D045F77");
        static byte[] DefaultKey = new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 
                                             0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76};

        private PasswordDeriveBytes pdb;

        public static BytesGenerator  Default = new BytesGenerator(DefaultPassword, DefaultKey);

        public BytesGenerator(Guid seed, byte[] key)
        {
            pdb = new PasswordDeriveBytes(seed.ToString(), key);
        }

        public byte[] GenerateKey(int length)
        {
            return pdb.GetBytes(length);
        }

    }
}
